home *** CD-ROM | disk | FTP | other *** search
- Path: ias_ppp0133.iamerica.net!72274.264
- From: 72274.264@compuserve.com (Sergey Kurtsev)
- Newsgroups: comp.lang.c++
- Subject: Re: .EXE/.COM Format....
- Date: Fri, 2 Feb 1996 12:49:37 -0500
- Organization: Hello, all.
- Message-ID: <72274.264.69.0014A387@compuserve.com>
- References: <31118F14.2818@iconn.net>
- NNTP-Posting-Host: ias_ppp0133.iamerica.net
- X-Newsreader: Trumpet for Windows [Version 1.0 Rev B]
-
- In article <31118F14.2818@iconn.net> Karl J Poglitsch Jr <kjpoglit@iconn.net> writes:
-
- From HelpPC
-
- DOS EXE
-
- Offset Size Description
-
- 00 word "MZ" - Link file .EXE signature (Mark Zbikowski?)
- 02 word length of image mod 512
- 04 word size of file in 512 byte pages
- 06 word number of relocation items following header
- 08 word size of header in 16 byte paragraphs, used to locate
- the beginning of the load module
- 0A word min # of paragraphs needed to run program
- 0C word max # of paragraphs the program would like
- 0E word offset in load module of stack segment (in paras)
- 10 word initial SP value to be loaded
- 12 word negative checksum of pgm used while by EXEC loads pgm
- 14 word program entry point, (initial IP value)
- 16 word offset in load module of the code segment (in paras)
- 18 word offset in .EXE file of first relocation item
- 1A word overlay number (0 for root program)
-
- - relocation table and the program load module follow the header
- - relocation entries are 32 bit values representing the offset
- into the load module needing patched
- - once the relocatable item is found, the CS register is added to
- the value found at the calculated offset
-
- Registers at load time of the EXE file are as follows:
-
- AX: contains number of characters in command tail, or 0
- BX:CX 32 bit value indicating the load module memory size
- DX zero
- SS:SP set to stack segment if defined else, SS = CS and
- SP=FFFFh or top of memory.
- DS set to segment address of EXE header
- ES set to segment address of EXE header
- CS:IP far address of program entry point, (label on "END"
- statement of program)
-
- DOS COM is just code w/o any format - loaded and executed as is.
-
- With all my wishes,
- Sergey.
-
- 72274.264@compuserve.com
- http://ourworld.compuserve.com/homepages/Sergey_Kurtsev
-
- ---
- Pessimist: Can't be worse :-(
- Optimist : Can be... Can be... :-]
-
- ( A joke :-)
-